//
//  ButtonAndLabel.m
//  10-HomeWork
//
//  Created by dllo on 16/7/27.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ButtonAndLabel.h"
@interface ButtonAndLabel ()
@property (nonatomic, strong)UIButton *button;
@property (nonatomic, strong)UILabel *label;
@end
@implementation ButtonAndLabel
- (instancetype)initWithFrame:(CGRect)frame button:(UIImage *)image label:(NSString *)labelText {
    self = [super initWithFrame:frame];
    if (self) {
        _button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height - 20)];
        [_button setImage:image forState:UIControlStateNormal];
        [self addSubview:_button];
        _label = [[UILabel alloc] initWithFrame:CGRectMake(0, self.bounds.size.height - 20, self.bounds.size.width, 20)];
        _label.textAlignment = NSTextAlignmentCenter;
        _label.text = labelText;
        [self addSubview:_label];
    }
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
